const router = require('koa-router')()
const ControllerUser = require('../controllers/userController')

router.prefix('/users')

router.get('/', ControllerUser.getAllUsers)

router.post('/', ControllerUser.save)

router.post('/login', ControllerUser.login)

router.post('/test-bcrypt', ControllerUser.testBcrypt)

router.put('/reset-password', ControllerUser.resetPassword)

router.put('/', ControllerUser.update)

router.put('/password', ControllerUser.updatePassword)

router.get('/bar', function (ctx, next) {
  ctx.body = 'this is a users/bar response'
})

module.exports = router
